package com.sq.partner.manager.service;

import java.util.List;

import com.sq.partner.manager.mybatis.model.CoreDept;
import com.sq.partner.manager.mybatis.model.DeptDto;
import com.sq.partner.manager.mybatis.model.GatewayRoleDept;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.util.Page;

public interface IGatewayRoleDeptService {

	/**
	 * 根据当前登录用户id，获取其所有所属权限机构
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	List<DeptDto> queryDeptDto(Long userid) throws Exception;
	
	
	/**
	 * 根据角色id获取配置的权限机构
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	List<DeptDto> queryDeptDtobyRoleId(Long roleId) throws Exception;
	
	/**
	 * 给某角色配置权限机构
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean addDeptsToOneRole(GatewayRoleDept roleDept) throws Exception;

	/**
	 * 给某角色配置权限机构
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean delDeptsToOneRole(Long roleId) throws Exception;
	
	/**
	 * 根据当前登录用户的角色获取权限机构
	 * @param user
	 * @return
	 * @throws Exception
	 */
	Page<CoreDept> queryDeptOfOneUser(Page<CoreDept> page,GatewayUser user) throws Exception;
	
	boolean updateRoleDeptInfo(GatewayRoleDept roleDept) throws Exception;
}
